/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "candidate_configuration")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CandidateConfiguration.findAll", query = "SELECT c FROM CandidateConfiguration c"),
    @NamedQuery(name = "CandidateConfiguration.findByIdCandidateConfiguration", query = "SELECT c FROM CandidateConfiguration c WHERE c.idCandidateConfiguration = :idCandidateConfiguration"),
    @NamedQuery(name = "CandidateConfiguration.findByShowOffers", query = "SELECT c FROM CandidateConfiguration c WHERE c.showOffers = :showOffers")})
public class CandidateConfiguration implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "EMAIL_NEW_SEARCH")
    private boolean emailNewSearch;
    @Basic(optional = false)
    @NotNull
    @Column(name = "EMAIL_ADQUIRED")
    private boolean emailAdquired;
    @Basic(optional = false)
    @NotNull
    @Column(name = "EMAIL_VISITED")
    private boolean emailVisited;
    @Basic(optional = false)
    @NotNull
    @Column(name = "EMAIL_VIDEO")
    private boolean emailVideo;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_CANDIDATE_CONFIGURATION")
    private Integer idCandidateConfiguration;
    @Basic(optional = false)
    @NotNull
    @Column(name = "SHOW_OFFERS")
    private boolean showOffers;
    @JoinColumn(name = "CANDIDATE", referencedColumnName = "ID_CANDIDATE")
    @ManyToOne(optional = false)
    private Candidate candidate;

    public CandidateConfiguration() {
    }

    public CandidateConfiguration(Integer idCandidateConfiguration) {
        this.idCandidateConfiguration = idCandidateConfiguration;
    }

    public CandidateConfiguration(Integer idCandidateConfiguration, boolean showOffers) {
        this.idCandidateConfiguration = idCandidateConfiguration;
        this.showOffers = showOffers;
    }

    public Integer getIdCandidateConfiguration() {
        return idCandidateConfiguration;
    }

    public void setIdCandidateConfiguration(Integer idCandidateConfiguration) {
        this.idCandidateConfiguration = idCandidateConfiguration;
    }

    public boolean getShowOffers() {
        return showOffers;
    }

    public void setShowOffers(boolean showOffers) {
        this.showOffers = showOffers;
    }

    public Candidate getCandidate() {
        return candidate;
    }

    public void setCandidate(Candidate candidate) {
        this.candidate = candidate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCandidateConfiguration != null ? idCandidateConfiguration.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CandidateConfiguration)) {
            return false;
        }
        CandidateConfiguration other = (CandidateConfiguration) object;
        if ((this.idCandidateConfiguration == null && other.idCandidateConfiguration != null) || (this.idCandidateConfiguration != null && !this.idCandidateConfiguration.equals(other.idCandidateConfiguration))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.CandidateConfiguration[ idCandidateConfiguration=" + idCandidateConfiguration + " ]";
    }

    public boolean getEmailAdquired() {
        return emailAdquired;
    }

    public void setEmailAdquired(boolean emailAdquired) {
        this.emailAdquired = emailAdquired;
    }

    public boolean getEmailVisited() {
        return emailVisited;
    }

    public void setEmailVisited(boolean emailVisited) {
        this.emailVisited = emailVisited;
    }

    public boolean getEmailVideo() {
        return emailVideo;
    }

    public void setEmailVideo(boolean emailVideo) {
        this.emailVideo = emailVideo;
    }

    public boolean getEmailNewSearch() {
        return emailNewSearch;
    }

    public void setEmailNewSearch(boolean emailNewSearch) {
        this.emailNewSearch = emailNewSearch;
    }
    
}
